package com.sync.syncmasterdata.customer.repository.biprep;

import com.sync.syncmasterdata.customer.entity.bip.BipCustomerEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 客户档案 dao 持久类
 */
@Repository
public interface BipCustomerRepository extends JpaRepository<BipCustomerEntity,Integer> {

    /**
     * 获取BIP 客户code
     * @param pkCustomer
     * @return
     */
    @Query(nativeQuery = true, value= "select code from bd_customer where pk_customer=:pkCustomer")
    String getCustomerEntity(@Param(value = "pkCustomer") String pkCustomer);

    @Query(nativeQuery = true, value= "select code,pk_customer from bd_customer where code=:code")
    BipCustomerEntity getCustomerEntityByCode(@Param(value = "code") String code);



}
